using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PointShadowDetecer : MonoBehaviour
{

    public GameObject player;

    public LayerMask layerMask;

    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        RaycastHit m_hit;
        Ray ray = new Ray(transform.position, player.transform.position - transform.position);
        if (Physics.Raycast(ray, out m_hit, Vector3.Distance(transform.position, player.transform.position),layerMask.value))
        {
                Debug.Log(m_hit.transform.name);
            Debug.DrawLine(transform.position, player.transform.position, Color.red);
        }
    }
}
